package android.slc.appbase.utils;


import android.slc.box.core.virtual_android.Bundle;

import java.io.Serializable;

public class AppIntentUtils {
    public static final String KEY_INTENT_DATA = "intentData";


    public static <T extends Serializable> T getDataByBundle(Bundle bundle) {
        if (bundle != null) {
            return (T) bundle.getSerializable(KEY_INTENT_DATA);
        }
        return null;
    }

    public static <T extends Serializable> Bundle getBundleByData(T data) {
        Bundle bundle = new Bundle();
        if (data != null) {
            bundle.putSerializable(KEY_INTENT_DATA, data);
        }

        return bundle;
    }

}
